/*
package cn.may.config;

import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.support.http.StatViewServlet;
import com.alibaba.druid.support.http.WebStatFilter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.Filter;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;


*/
/**
 * 导入数据源
 *
 * @author mayuanbao
 * @date 2019-06-12 11:33
 *//*

@Configuration
public class DruidConfig {
        @Bean
    @ConfigurationProperties(prefix = "spring.datasource")
    public DruidDataSource druidDataSource() {
        return new DruidDataSource();
    }

//    配置Druid监控

    */
/***
     * 配置管理后台的servlet
     * @author mayuanbao
     * @date 2019-06-12 14:04
     * @return org.springframework.boot.web.servlet.ServletRegistrationBean
     *//*


    @Bean
    public ServletRegistrationBean statViewServlet() {
        ServletRegistrationBean<StatViewServlet> bean = new ServletRegistrationBean<>(new StatViewServlet(), "/druid/*");
//        设置控制台管理用户
        bean.addInitParameter("loginUsername", "admin");
        bean.addInitParameter("loginPassword", "123456");
//        ip白名单，不配置或value为空则允许所有访问
        bean.addInitParameter("allow", "192.168.1.26");
//        ip黑名单,deny与allow共存时，deny优先于allow
        bean.addInitParameter("deny", "192.168.1.21");
//        是否可以重置数据
        bean.addInitParameter("resetEnable", "false");
        return bean;
    }

    */
/***
     * 配置web监控的filter
     * fetch data by []
     * @author mayuanbao
     * @date 2019-06-12 14:22
     * @return org.springframework.boot.web.servlet.FilterRegistrationBean
     *//*


    @Bean
    public FilterRegistrationBean webStatFilter() {
        FilterRegistrationBean<Filter> bean = new FilterRegistrationBean<>(new WebStatFilter());
//        忽略过滤
        bean.addInitParameter("exclusions", "*.js,*.gif,*.bmp,*.jpg,*.png,*.css,*.ico,/druid/*");
//        设置过滤路径
        bean.addUrlPatterns("/*");
        return bean;
    }
}
*/
